package com.akk.platform.manage;

import com.akk.module.app.entity.App;
import com.akk.platform.manage.business.AppBusiness;
import com.akk.utils.Query;
import com.akk.utils.RestResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
@RequestMapping("/platform/manage")
@Api(value = "manage-app",description = "平台后台接口-APP")
public class AppAction {

    @Autowired
    AppBusiness appBusiness;

    @GetMapping(value = "/applist")
    @ApiOperation(value = "APP列表",produces = MediaType.APPLICATION_JSON_VALUE, httpMethod = "GET", response = RestResponse.class)
    public RestResponse appList(@Valid Query query){
        return appBusiness.appList(query);
    }

    @GetMapping(value = "/selectapplist")
    @ApiOperation(value = "APP列表",produces = MediaType.APPLICATION_JSON_VALUE, httpMethod = "GET", response = RestResponse.class)
    public RestResponse selectAppList(){
        return appBusiness.selectAppList();
    }


    @PostMapping(value = "/appupdate")
    @ApiOperation(value = "APP信息修改",produces = MediaType.APPLICATION_JSON_VALUE, httpMethod = "POST", response = RestResponse.class)
    public RestResponse appUpdate(@RequestBody App app){
        return appBusiness.appUpdate(app);
    }

    @PostMapping(value = "/appadd")
    @ApiOperation(value="APP添加",produces = MediaType.APPLICATION_JSON_VALUE, httpMethod = "POST", response = RestResponse.class)
    public RestResponse appAdd(@RequestBody App app) {
        return appBusiness.appAdd(app);
    }







}
